// 导入路由组件
import { Router, Route /*Link*/ } from 'react-router-dom'
import { history } from './utils/history'

import './App.css'
// 在App组件中配置路由

// 导入页面组件
import Login from './pages/Login'
import LayoutHome from './pages/Layout'
import { AuthRoute } from './components/AuthRoute'

console.log('APP文件被加载了')
const App = () => {
  return (
    <Router history={history}>
      <div className='app'>
        {/* 
默认路由重定向
默认路由,推荐添加一个exact精确匹配 */}

        {/* 测试路由切换 */}
        {/* <Link to='/login'>登录页</Link>
        <br />
        <Link to='/home'>后台首页</Link> */}

        {/* 配置路由 */}

        <Route path='/login' component={Login}></Route>
        <AuthRoute path='/home' component={LayoutHome}></AuthRoute>
      </div>
    </Router>
  )
}
export default App
